package com.ghn.cocknovel.ui.activity.work.vm

import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.example.basemodel.base.BaseViewModel
import com.ghn.cocknovel.net.DataService
import com.kt.NetworkModel.bean.ResultListBean
import com.kt.NetworkModel.bean.ToDayWorkTaskBean
import com.kt.NetworkModel.net.CallBack
import com.kt.NetworkModel.net.RxUtils

/**
 *@author: Administrator
 *2023/10/17
 *desc:
 */
class WorkCalendarViewModel(application: Application) : BaseViewModel(application) {

    val mDateListLiveData = MutableLiveData<MutableList<String>>()

    /**
     * 查询司机所有排班日期
     */
    fun querySchedulePlanDateListNet() {
        DataService.querySchedulePlanDateList().compose(RxUtils.mainSync())
            .subscribe(object : CallBack<MutableList<String>>() {
                override fun onResult(result: MutableList<String>?) {
                    result?.also {
                        mDateListLiveData.value = it
                    }
                }
            })
    }

}